import java.util.Scanner;

public class HJ64 {
    public static void main(String[] args) {
        /**
         * 1.首先判断是几首歌 分为四首歌及其一下 四首歌以上
         *
         */
        Scanner sc = new Scanner(System.in);
        int music = sc.nextInt();
        String s = sc.next();
        char[] chars = s.toCharArray();
        int up =1;
        int down = 4;
        int index = 1;
        if(music <= 4){
            for (char aChar : chars) {
                if(aChar == 'U'){
                    if(index == 1){
                        index = music;
                    }else {
                        index--;
                    }
                }
                if(aChar == 'D'){
                    if(index == music){
                        index = 1;
                    }else {
                        index ++;
                    }
                }
            }
            int i =1;
            while( i <= music ){
                System.out.print(i+" ");
                i++;
            }
            System.out.println();
            System.out.println(index);
        }else {
            for (char aChar : chars) {
                if(aChar == 'U'){
                    if(index == 1){
                        index = music;
                        up = index -3;
                        down = index;
                    }else {
                        index--;
                        if(index>=up && index<=down){

                        }else {
                            up = index;
                            down = index+3;
                        }
                    }

                }
                if(aChar == 'D'){
                    if(index == music){
                        index = 1;
                        up = index;
                        down = index+3;

                    }else {
                        index++;
                        if(index>=up && index<=down)
                        {

                        }else {
                            up = index -3;
                            down = index;
                        }
                    }

                }
            }
            System.out.println(up+" "+(up+1)+" "+(up+2)+" "+(up+3));
            System.out.println(index);
        }
    }
}
